import requests,json
import pandas as pd
高德api_key = "ddcdad5238b943e23a92493fc7541ea8"
def geocode(key, formatted_address, city=None, batch="false", sig=None, output="json", callback=None):

    geocode_url = "https://restapi.amap.com/v3/geocode/geo?parameters"
    params = {
        "key": key,
        "address": formatted_address,
        "city": city,
        "batch": batch,
        "sig": sig,
        "output": output,
        "callback": callback
    }
    r = requests.get(geocode_url, params=params)
    return r.json()